<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head th:replace="fregments :: head(~{::title})">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>全局搜索</title>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="../static/lib/bootstrap-3.4.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="../static/css/my.css">
    <!-- 动画 -->
    <link rel="stylesheet" href="../static/css/animate.css">
</head>

<body>
<nav th:replace="fregments :: menu(0)" class="navbar navbar-default navbar-fixed-top m-padding">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">
                <img alt="Brand" src="../static/favicon.ico" style="width: 24px;">
            </a>
            <p class="navbar-text navbar-default"><a href="#" class="navbar-link m-a-none"><b>挚夕导航</b></a></p>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active"><a href="#"><span class="glyphicon glyphicon-home">&nbsp;</span>首页</a></li>
                <li><a href="#"><span class="glyphicon glyphicon-pencil">&nbsp;</span>学习</a></li>
                <li role="presentation" class="disabled"><a href="#"><span
                        class="glyphicon glyphicon-bookmark">&nbsp;</span>个人书签</a></li>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">
                        <img class="m-avatar img-circle" src="../static/images/me.jpg">
                        挚夕
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-left">
                        <li><a href="#"><span class="glyphicon glyphicon-th">&nbsp;</span>个人主页</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#"><span class="glyphicon glyphicon-log-out">&nbsp;</span>登出</a></li>
                    </ul>
                </li>
            </ul>

            <form class="navbar-form navbar-right">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="搜索" style="width: 300px;">
                </div>
                <button type="submit" class="btn btn-default">
                    <a class="glyphicon glyphicon-search m-none"></a>
                </button>
            </form>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<th:block th:replace="fregments :: modal"></th:block>

<div id="way-point" class="animated fadeIn">
    <div class="m-container" id="myContainer">
        <!-- 内容开始 -->
        <div name="content" class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 left-container">
                <!-- 面板开始 -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        搜索结果
                    </div>
                    <div class="panel-body row">
                        <div class="left-container col-xs-12 col-sm-12 col-md-12">
                            <!-- 搜索结果-->
                            <div class="col-xs-12 col-sm-12 col-md-12">
                                <!-- 链接列表-->
                                <!-- row start -->
                                <div class="row">
                                    <div class="col-xs-12 col-sm-6 col-md-3" th:each="link : ${links}">
                                        <div class="m-card row animated lightSpeedIn">
                                            <a class="m-padded-left-sm m-padded-none col-xs-11 col-sm-11 col-md-11 m-a-none"
                                               th:href="@{/link/{id}(id=${link.id})}">
                                                <!--                                    <div class="m-inline">-->
                                                <div class="m-margin-top-sm m-padded-none col-xs-2 col-sm-2 col-md-2">
                                                    <img class="m-png img-circle"
                                                         th:src="${link.icon}">
                                                </div>
                                                <div class="m-padded-none m-padded-top-sm col-xs-10 col-sm-10 col-md-10">
                                                    <div>
                                                        <strong th:text="${link.title}">哔哩哔哩</strong>
                                                    </div>
                                                    <!--                                            #strings.substring(link.brief, 0, #strings.length(link.brief) > 8 ? 8 : #strings.length(link.brief)) + '...'-->
                                                    <div class="text-muted m-brief-control m-inline"
                                                         th:text="${link.brief}">哔哩哔哩干杯
                                                    </div>
                                                </div>
                                                <!--                                    </div>-->
                                            </a>
                                            <a class="m-padded-none col-xs-1 col-sm-1 col-md-1 m-a-none m-padded-top"
                                               th:href="${link.url}" target="_blank"
                                               data-toggle="tooltip" data-placement="top" data-container="body"
                                               title="直达">
                                                <span class="glyphicon glyphicon-chevron-right">&nbsp;</span>
                                            </a>
                                        </div>
                                    </div>

                                </div> <!-- row end -->

                            </div>
                            <br><br><br><br>
                        </div><!-- 左边div结束-->
                    </div>
                </div><!-- 面板结束 -->
            </div>
        </div>
    </div>
</div>

<!--二维码-->
<div id="qrcode" style="display: none">

</div>
<br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br>
<footer th:replace="_fregments :: footer">
    <div>
        <div class="row">
            <div class="col-sm-4 col-md-4">
                <h3>挚夕导航</h3>
                <p>
                    挚夕导航最初源于本人想要做一个管理书签的系统。<br>
                    后来借鉴了一些导航网站，决定做一个网站导航。<br>
                    前端使用BootStrap。
                </p>
            </div>
            <div class="col-sm-8 col-md-8">
                占位
            </div>
        </div>
    </div>

    <div style="text-align: center;">
        Copyright 2023-now 挚夕导航 Designed by 挚夕
    </div>
</footer>

<!--/*/<th:block th:replace="fregments::script">/*/-->
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="../static/lib/jquery-1.12.4/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="../static/lib/bootstrap-3.4.1/js/bootstrap.min.js"></script>
<!--  bootstrap-dropdown-hover -->
<script src="../static/lib/bootstrap-dropdown-hover.js"></script>
<!--  二维码-->
<script src="../static/lib/qrcode/qrcode.min.js"></script>
<script>
    $(function () {
        //bootstrap-dropdown-hover
        $('.navbar [data-toggle="dropdown"]').bootstrapDropdownHover({
            // see next for specifications
        });
        setTimeout(() => {
            $(".m-card").removeClass("lightSpeedIn");
        }, 3000);
        //特效
        $("li").hover(function () {
            $(this).toggleClass("m-up");
        })
    });
</script>
<!--/*/</th:block>/*/-->

<script>
    function reloadScript() {
        setTimeout(() => {
            $(".m-card").removeClass("lightSpeedIn");
        }, 2000);
    }

    $(function () {
        //卡片特效
        $("#myContainer").on('mouseenter', '.m-card', function () {
            $(this).toggleClass("m-grow")
        });
        $("#myContainer").on('mouseleave', '.m-card', function () {
            $(this).toggleClass("m-grow")
        });

    });
</script>
</body>

</html>